Returns the connected [[enet.peer | peer]] at the specified index (starting at 1). ENet stores all [[enet.peer | peers]] in an array of the corresponding [[enet.host | host]] and re-uses unused peers for new connections. You can query the state of a peer using [[enet.peer:state | peer:state()]].
== Function ==
=== Synopsis ===
<source lang="lua">
host:get_peer(index)
</source>
=== Arguments ===
{{param|number|index|The index of the desired [[enet.peer | peer]].}}
=== Returns ===
{{param|enet.peer|peer|The desired [[enet.peer | peer]] structure.}}

== See Also ==
* [[parent::lua-enet]]
* [[enet.host]]
* [[enet.peer]]
== Other Languages ==
{{i18n|enet.host:get_peer}}